#include <new>
#include <cstdlib>

using namespace std;

void *operator new(size_t value)
{
	void * p = malloc(value);

	bad_alloc ex;
	if (p == NULL)
	{
		throw ex;
	}
}

void operator delete(void* p)
{
	free(p);
}

void *operator new[](size_t value)
{
	void * p = malloc(value);

	bad_alloc ex;
	if (p == NULL)
	{
		throw ex;
	}

}

void operator delete[](void *p)
{
	free(p);
}

